package cn.wolfcode.domain;

import cn.hutool.core.date.DateUtil;
import cn.wolfcode.enums.NoticeLevelEnum;
import cn.wolfcode.util.UserContext;
import com.alibaba.fastjson.JSON;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.util.Date;
import java.util.HashMap;
import java.util.List;
@Setter
@Getter
@ToString
public class Notice {
    /** 公告id*/
    private Long id;

    /** 公告标题*/
    private String title;

    /** 创建人*/
    private Employee createUser;

    /** 创建时间*/
    private Date createTime;

    /** 公告级别*/
    private Integer level;

    /** 公告内容*/
    private String info;

    /** 发布状态*/
    private boolean status;
    /** 已经阅读数*/
    private Integer readAmount;
    /** 未阅读数*/
    private Integer noReadAmount;
    /** 阅读状态*/
    private boolean readStatus;
    public String getLevelName(){
        return NoticeLevelEnum.findName(level);
    }
    public String getJson(){
        HashMap<String,Object> map = new HashMap();
        map.put("id",id);
        map.put("title",title);
        map.put("info",info);
        map.put("level",level);
        return JSON.toJSONString(map);
    }
}